********************************************************************************************************************************
***   Replication file for:                                                                                                  ***
***   Berbee, P., Braun, S. T. and Franke, R. (2024). Reversing Fortunes of German Regions, 1926-2019. JoEG.			     ***
***   							                                                                                             ***
***   SCRIPT: 	_x3c_preparation_turnover_1950.do																			 ***	
***   PURPOSE: 	Reads in and prepares turnover data from 1950 and 1955													 	 ***
********************************************************************************************************************************

* Preamble (unnecessary when executing run.do)
run "$reversing/scripts/programs/_config.do"

************
* Code begins
************

*** 1950

** Import data

import excel "$reversing/data/turnover1950.xlsx", sheet("Data") firstrow clear
keep Sheet1__La insg_u bev

rename insg_u turnover
*rename land_u turnover_agr
rename bev population
rename Sheet1__La labor_market_id
gen year = 1950

** Save data

sort labor_market_id
destring labor_market_id, replace
save "$reversing/processed/intermediate/turnover1950.dta",replace


*** 1955

** Import data

import excel "$reversing/data/turnover1955.xlsx", sheet("Data") firstrow clear
keep Sheet1__La insg_u pop_to_stat

rename insg_u turnover
*rename land_u turnover_agr
rename pop_to_stat population
rename Sheet1__La labor_market_id
gen year = 1955

** Save data

sort labor_market_id
destring labor_market_id, replace
save "$reversing/processed/intermediate/turnover1955.dta",replace


*** EOF